//
//  Upload_ErrorDailyViewController.m
//  fxxiaoke
//
//  Created by 鞠超 on 16/9/18.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "Upload_ErrorDailyViewController.h"

@interface Upload_ErrorDailyViewController () <UIScrollViewDelegate>

@property (nonatomic, strong) UIScrollView * scrollView;

@end

@implementation Upload_ErrorDailyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self p_navi];
    
    [self p_setupView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - navi
- (void )p_navi
{
    _btnLeft.hidden = YES;
    _lblLeft.hidden = YES;
    _btnRight.hidden = YES;
    _lblRight.hidden = YES;
    
    _lblTitle.text = @"上传错误日志";
    
    //左返回
    UIImageView * image_LeftRetrun = [[UIImageView alloc] initWithFrame:CGRectMake(11, 31.5, 25, 25)];
    image_LeftRetrun.userInteractionEnabled = YES;
    image_LeftRetrun.image = [UIImage imageNamed:@"Left-return.png"];
    [_topView addSubview:image_LeftRetrun];
    
    UILabel * lbl_return = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(image_LeftRetrun.frame) - 6, 35, 35, 15)];
    lbl_return.text = @"常规";
    lbl_return.textColor = [UIColor whiteColor];
    lbl_return.font = [UIFont systemFontOfSize:17];
    [_topView addSubview:lbl_return];
    
    UIButton * btn_return = [UIButton buttonWithType:(UIButtonTypeSystem)];
    btn_return.frame = CGRectMake(10, 22, 60, 40);
    [_topView addSubview:btn_return];
    [btn_return addTarget:self action:@selector(btn_returnAction:) forControlEvents:(UIControlEventTouchUpInside)];
}

//左返回
- (void )btn_returnAction:(UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

//显示tabbar
- (void )viewWillAppear:(BOOL)animated
{
    [(AppDelegate *)[[UIApplication sharedApplication] delegate] hiddenTabBar];
}

#pragma mark - 布局
- (void )p_setupView
{
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 64)];
    self.scrollView.backgroundColor = [UIColor whiteColor];
    self.scrollView.showsVerticalScrollIndicator = NO;
    self.scrollView.contentSize = CGSizeMake(0, SCREEN_HEIGHT - 60);
    self.scrollView.delegate = self;
    [self.view addSubview:self.scrollView];
    
    //
    UIImageView * image_cloud = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH / 2 - 50, 25, 100, 100)];
    image_cloud.image = [UIImage imageNamed:@"big_CloudError.png"];
    [self.scrollView addSubview:image_cloud];
    
    //详情介绍
    UILabel * lbl_detail1 = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(image_cloud.frame) + 15, SCREEN_WIDTH - 30, 15)];
    lbl_detail1.text = @"通过上传错误日志数据";
    lbl_detail1.textColor = [UIColor grayColor];
    lbl_detail1.textAlignment = NSTextAlignmentCenter;
    lbl_detail1.font = [UIFont systemFontOfSize:17.0f];
    [self.scrollView addSubview:lbl_detail1];
    
    UILabel * lbl_detail2 = [[UILabel alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(lbl_detail1.frame) + 5, SCREEN_WIDTH - 30, 15)];
    lbl_detail2.text = @"帮助我们改进产品和服务";
    lbl_detail2.textColor = [UIColor grayColor];
    lbl_detail2.textAlignment = NSTextAlignmentCenter;
    lbl_detail2.font = [UIFont systemFontOfSize:17.0f];
    [self.scrollView addSubview:lbl_detail2];
    
    //立即上传
    UIButton * btn_upload = [UIButton buttonWithType:(UIButtonTypeSystem)];
    btn_upload.frame = CGRectMake(15, CGRectGetMaxY(lbl_detail2.frame) + 60, SCREEN_WIDTH - 30, 40);
    btn_upload.layer.cornerRadius = 5;
    btn_upload.backgroundColor = [UIColor colorWithRed:90/255.0 green:167/255.0 blue:239/255.0 alpha:1.0];
    [btn_upload setTitle:@"立即上传" forState:(UIControlStateNormal)];
    [btn_upload setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    btn_upload.titleLabel.font = [UIFont systemFontOfSize:15.0f];
    [self.scrollView addSubview:btn_upload];
    
    [btn_upload addTarget:self action:@selector(btn_uploadAction:) forControlEvents:(UIControlEventTouchUpInside)];
}

#pragma mark - 点击立即上传
- (void )btn_uploadAction:(UIButton *)sender
{
    NSLog(@"点击立即上传错误日志");
}



















@end
